﻿List<List<string>> lists = new List<List<string>>()
{
    new List<string>(){ "1","2","3"},
    new List<string>(){ "4","5","6"},
    new List<string>(){ "7","8","9"},
};
int i = 0;
foreach (var list in lists)
{
    foreach (var item in list)
    {
        i++;
        if (item == "5")
        {
            goto next;
        }
    }
}
next:
Console.WriteLine($"循环了{i}次");
;